<?
/*读取某个模特的所以相册：模特分类之前的子分类*/
//http://t.assy.com/api/assy/model_album_list.php?nid=459

include_once("base.php");

$_model_term_nid=$_REQUEST['nid'];


//取出该模特的所有相册nid
$_album_array    = select_lines_items($table_prefix."relation","","detail_nid","term_nid = '".$_model_term_nid."' ","");
$_album_id_array = transform_2darray_in_1darray_number_as_key($_album_array,"detail_nid");
$_album_list_str = implode("','",$_album_id_array);



//用封装的语句获取对应的数据
$_model_term_list_detail=select_lines_items($table_prefix."detail",
                                         "listorder desc , nid desc",
                                            "name,nid,icon",
                                         "belong = 'product' and publish = '1' and nid in ('".$_album_list_str."')","");

$img_path = ROOT_PATH_."/uploadfiles/".$theme_folder."/";
$result=array_map(function($val) use ($img_path) {
   list($width, $height) = getimagesize($img_path.$val['icon']);
   return array_merge($val, compact('width', 'height'));
}, $_model_term_list_detail);
 
//按照格式输出数据
echo out("success",0,$result);


?>